<?php
/**
 * Zhub - A PHP Framework For API Developer
 *
 * This file is part of the Zhub package.
 *
 * (c) YiLong Fan <fantiq@163.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 *
 * @author fanyilong <fantiq@163.com>
 * @copyright 2017 fanyilong. All rights reserved.
 * @package Zhub
 * @date 18-3-12
 */

namespace Tests\DataStruct;


use Zhub\DataStruct\Struct;

class StubStruct extends Struct
{
    const FOO = 'foo';

    const BAR = 'bar';

    const BIZ = 'biz';

    const OPS = 'ops';

    const BIO = 'bio';

    public static function initialize(): array
    {
        return [
            self::FOO => "name",
            self::BAR => 12,
            self::BIZ => null,
            self::OPS => function () {return Ops::class;},
            self::BIO => function () {return new Bio('PM');}
        ];
    }

    public function getFoo(){return $this->get(self::FOO);}
    public function setFoo($foo){$this->set(self::FOO, $foo);}

    public function getBar(){return $this->get(self::BAR);}
    public function setBar($bar){$this->set(self::BAR, $bar);}

    public function getBiz(){return $this->get(self::BIZ);}
    public function setBiz($biz){$this->set(self::BIZ, $biz);}

    public function getOps(){return $this->get(self::OPS);}
    public function setOps($ops){$this->set(self::OPS, $ops);}

    public function getBio(){return $this->get(self::BIO);}
    public function setBio($bio){$this->set(self::BIO, $bio);}
}

class Ops{}

class Bio{
    public $profession = null;
    public function __construct($profession)
    {
        $this->profession = $profession;
    }
}
